package com.example.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.Environment;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * 蔡定努
 * 2025/06/18 10:54
 */
@Configuration
@PropertySource("classpath:db/db.properties")
public class DBconfig {

    @Value("${db.name}")
    String name;


    @PostConstruct
    public void init() {
        System.out.println("Database Name: " + name);
    }


}
